home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9816 < prev    next >
Encoding:
Text File  |  1996-08-05  |  625 b   |  37 lines

  1. Path: crl.crl.com!not-for-mail
  2. From: dbridges@crl.com (Dick Bridges)
  3. Newsgroups: comp.lang.c++
  4. Subject: [Q] namespace #2
  5. Date: 4 Mar 1996 09:11:22 -0800
  6. Organization: CRL Network Services      (415) 705-6060  [Login: guest]
  7. Message-ID: <4hf87q$b2h@crl.crl.com>
  8. NNTP-Posting-Host: crl.com
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. Given the following namespace:
  12.  
  13. namespace A
  14. {
  15.     int i = 56;
  16. };
  17.  
  18. How (or can) you use it in two *DIFFERENT* source files?  For example:
  19.  
  20. in one.cpp...
  21.  
  22. void foo()
  23. {
  24.     using namespace A;
  25.     cout << i << endl;
  26. }
  27.  
  28. and in two.cpp...
  29.  
  30. void bar()
  31. {
  32.     using namespace A;
  33.     cout << i << endl;
  34. }
  35.  
  36. TIA for an answer.
  37.